package com.tiger.ebenv.sample1;

import javax.naming.Context;
import javax.naming.InitialContext;

public class EnvEntryTestBean implements javax.ejb.SessionBean {
	private javax.ejb.SessionContext sessionContext;

	public void setSessionContext(javax.ejb.SessionContext sessionContext) {
		this.sessionContext = sessionContext;
	}

	public void ejbCreate() throws javax.ejb.CreateException {
	}

	public String getString() {
		try {
			InitialContext ctx = new InitialContext();
			String stringEntry = (String) ctx.lookup("java:comp/env/StringEntry");
			return stringEntry;
		} catch (javax.naming.NamingException e) {
			throw new javax.ejb.EJBException(e);
		}
	}

	public Integer getInteger() {
		try {
			InitialContext ctx = new InitialContext();
			Integer integerEntry = (Integer) ctx.lookup("java:comp/env/IntegerEntry");
			return integerEntry;
		} catch (javax.naming.NamingException e) {
			throw new javax.ejb.EJBException(e);
		}
	}

	public Boolean getBoolean() {
		try {
			InitialContext ctx = new InitialContext();
			Boolean booleanEntry = (Boolean) ctx.lookup("java:comp/env/BooleanEntry");
			return booleanEntry;
		} catch (javax.naming.NamingException e) {
			throw new javax.ejb.EJBException(e);
		}
	}

	public Double getDouble() {
		try {
			InitialContext ctx = new InitialContext();
			Context env = (Context) ctx.lookup("java:comp/env");
			Double doubleEntry = (Double) env.lookup("DoubleEntry");
			return doubleEntry;
		} catch (javax.naming.NamingException e) {
			throw new javax.ejb.EJBException(e);
		}
	}

	public Byte getByte() {
		try {
			InitialContext ctx = new InitialContext();
			Context env = (Context) ctx.lookup("java:comp/env");
			Byte byteEntry = (Byte) env.lookup("ByteEntry");
			return byteEntry;
		} catch (javax.naming.NamingException e) {
			throw new javax.ejb.EJBException(e);
		}
	}

	public Short getShort() {
		try {
			InitialContext ctx = new InitialContext();
			Context env = (Context) ctx.lookup("java:comp/env");
			Short shortEntry = (Short) env.lookup("ShortEntry");
			return shortEntry;
		} catch (javax.naming.NamingException e) {
			throw new javax.ejb.EJBException(e);
		}
	}

	public Long getLong() {
		try {
			InitialContext ctx = new InitialContext();
			Context env = (Context) ctx.lookup("java:comp/env");
			Long longEntry = (Long) env.lookup("LongEntry");
			return longEntry;
		} catch (javax.naming.NamingException e) {
			throw new javax.ejb.EJBException(e);
		}
	}

	public Float getFloat() {
		try {
			InitialContext ctx = new InitialContext();
			Context env = (Context) ctx.lookup("java:comp/env");
			Float floatEntry = (Float) env.lookup("FloatEntry");
			return floatEntry;
		} catch (javax.naming.NamingException e) {
			throw new javax.ejb.EJBException(e);
		}
	}

	public void ejbActivate() {
	}

	public void ejbPassivate() {
	}

	public void ejbRemove() {
	}
}
